<!-- 
//****************************************************************** 
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved. 
//* 
//* 
//* $$Workfile:   economicIndexDef.jsp  $$ 
//* $$Revision:   1.0  $$ 
//* $$Author:   JLOPE262  $$ 
//* $$Date:   Nov 14 2008 08:58:08  $$ 
//* 
//* Description: Description of file goes here 
//****************************************************************** 
--> 
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="ford-arg/tags" prefix="ft" %>

<script language="javascript">

	function findEconomicIndexDef() {
		document.EconomicIndexDefForm.action = "EconomicIndexDefActionFind.do";
				document.EconomicIndexDefForm.state.value = "find";
		document.EconomicIndexDefForm.submit();
	}
	function clearEconomicIndexDef(){
		document.EconomicIndexDefForm.action = "EconomicIndexDefActionNew.do";
		document.EconomicIndexDefForm.state.value = "new";

	}
	function createUpdateEconomicIndexDef() {
		document.EconomicIndexDefForm.action = "EconomicIndexDefActionCreateUpdate.do";
		document.EconomicIndexDefForm.state.value = "newSave";		
	}
	function deleteEconomicIndexDef() {
		document.EconomicIndexDefForm.action = "EconomicIndexDefActionDelete.do";
		document.EconomicIndexDefForm.state.value = "delete";		
	}
	function createEconomicSource() {
		document.EconomicIndexDefForm.action = "EconomicSourceActionInit.do";
	}

	function selectDesc(){
	document.getElementById("codeFind").value = "";

	}
	function selectCode(){
	document.getElementById("descFind").value = "";

	}
	function deleteEconomicIndexFromList() {
	
			document.EconomicIndexDefForm.action = "EconomicIndexDefActionDelete.do";

	}
	function editEconomicIndexFromList() {
		document.EconomicIndexDefForm.action = "EconomicIndexDefActionFind.do";
		document.EconomicIndexDefForm.state.value = "edit";		
		document.EconomicIndexDefForm.screen="detail";
	}
	
	function proposeEconomicIndexFromList(){
		document.EconomicIndexDefForm.action = "EconomicIndexDefPropose.do";
		document.EconomicIndexDefForm.submit();
	}
	
	function approveEconomicIndexFromList(){
		document.EconomicIndexDefForm.action = "EconomicIndexDefApprove.do";
		document.EconomicIndexDefForm.submit();
	}	
	function economicIndexList(){
		document.EconomicIndexDefForm.action = "EconomicIndexList.do";
		document.EconomicIndexDefForm.submit();
	}	
	
	function economicIndexDef(){
	document.EconomicIndexDefForm.action = "EconomicIndexDefActionInit.do";
	}

	
</script>

<table>
	<tr>
		<td colspan="2">
		<h2><bean:message key="economicIndexDef.label.title" /></h2>
		</td>
	</tr>
</table>
<html:form action="/EconomicIndexDefActionFind">
<html:hidden property="state" />
	<table>
		<tr>
			<td>
				<table>
					<tr>
						<td class="text_blue_bold align_left" colspan="100%">
							<bean:message key="costStructure.item.label.filter" />
						</td>
					</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="economicSource"/>
						</td>
						<td class="align_left">
						<html:select property="sourcFind">
						<html:option value="-1" key="label.allOption"/>
						<html:options collection="economicSources"
							property="eese02EconsourceNumberK"
							labelProperty="eese02EconsourceNameN" />
						</html:select>
<!-- <html:submit styleClass="button" onclick="createEconomicSource();">
						<bean:message key="economicIndexDef.button.newsource" />
						</html:submit>
						&nbsp;
						-->
						<logic:equal property="screen" value="List" name="EconomicIndexDefForm">	
							<html:submit styleClass="button" onclick="clearEconomicIndexDef();">
								<bean:message key="economicIndexDef.button.neweconomic" />
							</html:submit>
						</logic:equal>
						</td>
					</tr>
				<tr>
						<td class="text_blue_bold align_left">
						<bean:message
						key="economicIndexDef.label.code" />
					</td>
					<td class="align_left">
						<html:text property="codeFind"
						maxlength="8" onfocus="selectCode();" />
					</td>
					
				</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="costStructure.item.label.name" />
						</td>
						<td class="align_left">
						<html:text property="descFind" maxlength="25" onfocus="selectDesc();" />&nbsp;
						<html:button property= "find" styleClass="button" onclick="findEconomicIndexDef();">
						<bean:message key="economicIndexDef.button.find" />
						</html:button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="15px">
			</td>
		</tr>
	<%-- ################################################################################# --%>
	<%-- ######################    SCREEN BROWSER    ##################################### --%>
	<%-- ################################################################################# --%>		
	<logic:equal property="screen" value="detail" name="EconomicIndexDefForm">		
	
		<tr>
					<td>
						<table class="table1"  style="width: 600px;">
						
								<tr>
									<td class="text_blue_bold align_left"><bean:message key="economicIndexDef.label.code" /></td>
									<td colspan="2" class="align_left"><bean:write name="EconomicIndexDefForm" property="economicIndexDefSelected.eese01EconNumberK" /></td>
								</tr>
								<tr>
									<td class="text_blue_bold align_left"><bean:message key="economicIndexDef.label.description" /></td>
									<td colspan="2" class="align_left"><html:text property="economicIndexDefSelected.eese01EconNameN" maxlength="50" /></td>
								</tr>

								<tr>
									<td class="text_blue_bold align_left"><bean:message key="economicIndexDef.label.source" /></td>
									<td colspan="2" class="align_left"><html:select property="sourcSelec">
										<html:option value="-1">-Seleccionar-</html:option>
										<html:options collection="economicSources" property="eese02EconsourceNumberK" labelProperty="eese02EconsourceNameN" />
									</html:select>
									</td>
								</tr>
								<tr>
										<td height="15px" colspan="100%"></td>
									</tr>
								<tr>
									<td class="text_blue_bold align_left"><bean:message key="economicIndexDef.label.unitm" /></td>
									<td colspan="2" class="align_left"><html:select property="currency">
										<html:option value="-1">-Seleccionar-</html:option>
										<html:options collection="economicMeasure" property="eesm01CurrencyCodeC" labelProperty="eesm01CurrencyCodeC" />
									</html:select></td>
								</tr>
								<tr>
								
									</tr>
								<tr>
									<td class="text_blue_bold align_left"><bean:message key="economicIndexDef.label.unitfre" /></td>
									<td colspan="2" class="align_left"><html:text property="economicIndexDefSelected.eese01EconQuantityQ" maxlength="2" />
									<html:select property="economicIndexDefSelected.eese01EconQuantityTypeC">
									<html:option value="-1">-Seleccionar-</html:option>
									<html:option value="M">Mes/es</html:option>
									<html:option value="D">Dia/s</html:option>
									</html:select>
									</td>
					<tr>
						<td style="height: 100px">
						</td>						
					</tr>
					<tr>
						<td colspan="100%">
						<hr />
			<!--  Begin Permisos  -->
								<table class="table1" style="width: 590px;">
								<tr>
									<td class="align_left">					
										<logic:notEmpty property="economicIndexDefSelected" name="EconomicIndexDefForm" >
												<bean:define id="economicIndex" name="EconomicIndexDefForm" property="economicIndexDefSelected" />
										</logic:notEmpty>			
										<logic:empty property="eese01CreateUserC" name="economicIndex">
											<html:submit onclick="createUpdateEconomicIndexDef();" styleClass="button"><bean:message key="label.save" /></html:submit>
										</logic:empty>
										<logic:notEmpty property="eese01CreateUserC" name="economicIndex">
											<bean:define id="eese01CreateUserC" name="economicIndex" property="eese01CreateUserC" />
											<bean:define id="eese01CreateS" name="economicIndex" property="eese01CreateS" />
											<bean:message key="text.createdBy" arg0="${eese01CreateUserC}" arg1="${eese01CreateS}" />
										</logic:notEmpty>
									</td>
								</tr>
								<tr>
 									<td class="align_left">
										<logic:notEmpty property="eese01CreateUserC" name="economicIndex">
											<logic:empty property="eese01EconProposalUserC" name="economicIndex">
												<html:submit  styleClass="button" onclick="proposeEconomicIndexFromList();">
													<bean:message key="label.propose" />
												</html:submit>
											</logic:empty>
										</logic:notEmpty>
										<logic:notEmpty property="eese01EconProposalUserC" name="economicIndex">
											<bean:define id="eese01EconProposalUserC" name="economicIndex" property="eese01EconProposalUserC" />
											<bean:define id="eese01EconProposalS" name="economicIndex" property="eese01EconProposalS" />
											<bean:message key="text.proposedBy" arg0="${eese01EconProposalUserC}" arg1="${eese01EconProposalS}" />
										</logic:notEmpty>
									</td>								
								</tr>
								<tr>
									<td class="align_left">
										<logic:notEmpty property="eese01EconProposalUserC" name="economicIndex">
											<logic:empty property="eese01EconApprovalUserC" name="economicIndex">
												<html:button property="approve" onclick="approveEconomicIndexFromList();" styleClass="button"><bean:message key="label.approve" /></html:button>											
											</logic:empty>											
										</logic:notEmpty>
										<logic:notEmpty property="eese01EconApprovalUserC" name="economicIndex">
											<bean:define id="eese01EconApprovalUserC" name="economicIndex" property="eese01EconApprovalUserC" />
											<bean:define id="eese01EconApprovalS" name="economicIndex" property="eese01EconApprovalS" />
											<bean:message key="text.approvedBy" arg0="${eese01EconApprovalUserC}" arg1="${eese01EconApprovalS}" />
										</logic:notEmpty>
									</td>
								</tr>
								<tr>
									<td class="align_left">
										<logic:notEmpty property="eese01LastUpdtUserC" name="economicIndex">
											<bean:define id="eese01LastUpdtUserC" name="economicIndex" property="eese01LastUpdtUserC" />
											<bean:define id="eese01LastUpdtS" name="economicIndex" property="eese01LastUpdtS" />										
											<bean:message key="text.lastModifiedBy" arg0="${eese01LastUpdtUserC}" arg1="${eese01LastUpdtS}" />
										</logic:notEmpty>
									</td>
								</tr>
							</table>
						</td>
					</tr>					
				</table>
			</td>
							<!-- Permiso -->
					<td></td>
					<td class="align_left" valign="top" >
					<br/>
									<html:submit
										styleClass="button"
										onclick="clearEconomicIndexDef();">
										<bean:message key="economicIndexDef.button.neweconomic" />
									</html:submit>
									<br/>
									<br/>
									<html:submit 
										styleClass="button" onclick="deleteEconomicIndexDef();">
										<bean:message key="economicIndexDef.button.deleteconomic" />
									</html:submit>
									<br/>
									<br/>
									<html:submit 
										styleClass="button" onclick="createUpdateEconomicIndexDef();">
										<bean:message key="economicIndexDef.button.savechanges" />
									</html:submit>
									<br/>
									<br/>								
									<html:button
										styleClass="button" property="discard"
										onclick="economicIndexList();">
										<bean:message key="economicIndexDef.button.discarchanges" />
									</html:button>

						<br/>
					</tr>

	</logic:equal>
	<%-- ################################################################################# --%>
	<%-- ######################    LIST SCREEN       ##################################### --%>
	<%-- ################################################################################# --%>	
	<logic:equal property="screen" value="List" name="EconomicIndexDefForm">		

	<table>
		<bean:define id="codeTitle">
			<bean:message key="economicIndexDef.label.code" />
		</bean:define>
		<bean:define id="descriptionTitle">
			<bean:message key="economicIndexDef.label.description" />
		</bean:define>
		<bean:define id="sourceTitle">
			<bean:message key="economicIndexDef.label.source" />
		</bean:define>
		<bean:define id="updateFreqTitle">
			<bean:message key="economicIndexDef.label.unitfre" />
		</bean:define>		
		<bean:define id="unidadMonedaTitle">
			<bean:message key="economicIndexDef.label.currency" />
		</bean:define>
		<bean:define id="creationTitle">
			<bean:message key="costStructure.label.tableHeader.creation" />
		</bean:define>
		<bean:define id="approvalTitle" >
			<bean:message key="economicIndex.label.tableHeader.approval" />
		</bean:define>
		<bean:define id="actionsTitle">
			<bean:message key="economicIndex.label.tableHeader.actions" />
		</bean:define>		
		<bean:define id="proposalTitle">
			<bean:message key="costStructure.label.tableHeader.proposal" />
		</bean:define>

		<tr>
			<td class="text_blue_bold align_left">
				<ft:saveActivePageNumber />
				<display-el:table 	class="table1" style="width: 800px;" cellpadding="5" uid="economicIndex"
									pagesize="20" name="sessionScope.EconomicIndexDefForm.econominIndex" 
									excludedParams="*" requestURI="EconomicIndexActionPaginate.do">
					<display-el:column title="${codeTitle}" property="eese01EconNumberK" style="width: 25%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${descriptionTitle}" property="eese01EconNameN" style="width: 25%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${sourceTitle}" property="eese01EconsourceNumberR.eese02EconsourceNameN" style="width: 25%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>
					<display-el:column title="${updateFreqTitle}" style="width: 25%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">${economicIndex.eese01EconQuantityQ}
					<bean:define id="typeC">
						${economicIndex.eese01EconQuantityTypeC}
					</bean:define>					
								<logic:equal value="D" name="typeC">					
						<bean:message key="economicIndex.label.dia" />					
					</logic:equal>
					<logic:equal name="typeC" value="M">					
						<bean:message key="economicIndex.label.mes" />					
					</logic:equal> 
					</display-el:column>
					<display-el:column title="${unidadMonedaTitle}" property="eese01CurrencyCodeC.eesm01CurrencyCodeC" style="width: 25%;"  class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>
					<display-el:column title="${creationTitle}" style="width: 25%;"  decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">${economicIndex.eese01CreateUserC}<br />${economicIndex.eese01CreateS}</display-el:column>
					<display-el:column title="${proposalTitle}" style="width: 25%;"  decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">					
					<logic:empty name="economicIndex" property="eese01EconProposalUserC">
							<html:submit property="economicIndexMapped(${economicIndex_rowNum})" styleClass="button" onclick="proposeEconomicIndexFromList();"><bean:message key="label.propose" /></html:submit>
						</logic:empty>
						<logic:notEmpty name="economicIndex" property="eese01EconProposalUserC">
							${economicIndex.eese01EconProposalUserC}<br />${economicIndex.eese01EconProposalS}
						</logic:notEmpty>
					</display-el:column>
					<display-el:column title="${approvalTitle}" style="width: 25%;" decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
					<logic:notEmpty name="economicIndex" property="eese01EconProposalUserC">					
							<logic:empty name="economicIndex" property="eese01EconApprovalUserC">
							<html:submit property="economicIndexMapped(${economicIndex_rowNum})" styleClass="button" onclick="approveEconomicIndexFromList();"><bean:message key="label.approve" /></html:submit>
						</logic:empty>
					</logic:notEmpty>
						<logic:notEmpty name="economicIndex" property="eese01EconApprovalUserC">
							${economicIndex.eese01EconApprovalUserC}<br />${economicIndex.eese01EconApprovalS}
						</logic:notEmpty>
					</display-el:column>
					<display-el:column title="${actionsTitle}" style="width: 25%;" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
						<html:submit property="economicIndexMapped(${economicIndex_rowNum})" styleClass="button" onclick="editEconomicIndexFromList();"><bean:message key="label.edit" /></html:submit>&nbsp;
						<html:submit property="economicIndexMapped(${economicIndex_rowNum})" styleClass="button" onclick="deleteEconomicIndexFromList();"><bean:message key="label.delete" /></html:submit>						
					</display-el:column>
				</display-el:table>			
			</td>
		</tr>
	</table>
</logic:equal>

</table>
</html:form>